#include <stdio.h>

int main(int argc, char *argv[]) {

    int n = 0, flag = 1;
    scanf("%d", &n);

    for (size_t i = 2; i < n; i++)
    {
        if(n%i==0)
        flag = 0;
    }
    
    if(flag)
        printf("Y");
    else
        printf("N");

    return 0;
}